package cii_lib;


public class JSserverException extends Exception {
  public enum FUNCTION {OPEN, CLOSE, WRITE, READ};
  public enum ACTION {OPEN_SERVER, OPEN_SOCKET, CLOSE_SOCKET, OPEN_TX_CHAN, OPEN_RX_CHAN, TX_CHAN_SEND, RX_CHAN_REC, DATA_CONV, PARAMETER};
  private static final long serialVersionUID = 1L;
  private FUNCTION Function;
  private ACTION Action;
  JSserverException(FUNCTION function, ACTION action){
    super("JSserverException \'"+function.toString()+"\' function error: "+action.toString());
    Function = function;
    Action = action;
  }
  public ACTION getAction() {
    return Action;
  }
  public FUNCTION getFunction() {
    return Function;
  }
  
  public void exitMessage() {
    System.out.printf(this.getMessage()+"\n");
    System.exit(0);
  }
  
}
